import request from '@/utils/request'

// 查询用户优惠券列表
export function listUsercoupon(query) {
  return request({
    url: '/order/usercoupon/list',
    method: 'get',
    params: query
  })
}

// 查询用户优惠券详细
export function getUsercoupon(id) {
  return request({
    url: '/order/usercoupon/' + id,
    method: 'get'
  })
}

// 新增用户优惠券
export function addUsercoupon(data) {
  return request({
    url: '/order/usercoupon',
    method: 'post',
    data: data
  })
}
// 修改用户优惠券
export function updateUsercoupon(data) {
  return request({
    url: '/order/usercoupon',
    method: 'put',
    data: data
  })
}

// 删除用户优惠券
export function delUsercoupon(id) {
  return request({
    url: '/order/usercoupon/' + id,
    method: 'delete'
  })
}

// 优惠券模板下拉
export function getUsercouponSelect(){
  return request({
    url: '/order/coupontem/select',
    method: 'get'
  })
}
// 作废
export function cancelUsercoupon(id){
  return request({
    url: '/order/usercoupon/cancle/' + id,
    method: 'get'
  })
}